---
layout: example
category: example
title: Add a third party vector tile source
description: 'Render a map using an external vector source of OpenStreetMap data provided by <a target="_blank" href="http://mapzen.com/vector/">Mapzen</a>.'
tags:
  - sources
---
<div id='map'></div>
<script>
var simple = {
    "version": 8,
    "sources": {
        "osm": {
            "type": "vector",
            "tiles": ["https://vector.mapzen.com/osm/all/{z}/{x}/{y}.mvt?api_key=vector-tiles-LM25tq4"]
        }
    },
    "layers": [
        {
            "id": "background",
            "type": "background",
            "paint": {
                "background-color": "#41afa5"
            }
        }, {
            "id": "water",
            "type": "fill",
            "source": "osm",
            "source-layer": "water",
            "filter": ["==", "$type", "Polygon"],
            "paint": {
                "fill-color": "#3887be"
            }
        }
    ]
};

var map = new mapboxgl.Map({
    container: 'map',
    style: simple,
    zoom: 1,
    center: [-14, 35]
});

map.addControl(new mapboxgl.NavigationControl());
</script>
